home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-04 | 1.9 KB | 59 lines | [TEXT/MPS ] |
- # **********************************************************************
- # File: Script 6.vu
- #
- # Purpose: to demonstrate the ability to use localizing techniques
- #
- # Caution: To run this script you must change the path to indicate
- # the current location of the file "Tutorial Localize
- # Resource." in your host Macintosh.
- # Look for the comment ### !Substitute your path
- # here in the script.
- #
- # Written by: David Gaxiola
- #
- # Copyright © 1992 by Apple Computer, Inc., all rights reserved.
- # **********************************************************************
-
- # *******************************************************************
- # task printFromRsrc( IDNum, howMany, filename )
- # will print out the specified number of strings from the file
- # filename or the script file if filename is not specified.
- task printFromRsrc( IDNum := 128, howMany := 1, filename )
- begin
- for counter := 1 to howMany do
- begin
- if IsUndefined(filename) do
- println getIndString( IDNum, counter );
- else
- println getIndString( IDNum, counter, filename );
- end;
- println;
- end;
-
- # *******************************************************************
- # Begin main body. #
-
- # Associate the name of the language with its corresponding
- # resource ID number.
- script Tutorial6Main()
- begin
- languages := { { "English", 773 }, { "Gibberish", 463 },
- { "Français", 838 } };
- listSize := 4;
- ### !Substitute your path here -
- thePath := "Tutorial Localize Resource";
-
- # Note the use of the assoc built-in task and the
- # printFromRsrc task defined above.
-
- langID := Assoc( "English", languages );
- printFromRsrc( langID, listSize, thePath );
- langID := Assoc( "Français", languages );
- printFromRsrc( langID, listSize, thePath );
- langID := Assoc( "Gibberish", languages );
- printFromRsrc( langID, listSize, thePath );
- end;
-
- # End main body.
- # *******************************************************************
-